Skip to content

fix(auth): adds missing EMAIL_NOT_FOUND error code #550

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 4, 2021

Conversation

bojeil-google
Copy link
Contributor

Catch EMAIL_NOT_FOUND and translate to EmailNotFoundError when /accounts:sendOobCode is called for password reset on a user that does not exist.

Catch EMAIL_NOT_FOUND and translate to EmailNotFoundError  when /accounts:sendOobCode is called for password reset on a user that does not exist.
Copy link
Member

@lahirumaramba lahirumaramba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @bojeil-google !
LGTM. Please add a TW to review the reference doc changes.

Copy link
Contributor

@hiranya911 hiranya911 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One possible typo. Can we also add a test case? Similar to:

def test_get_user_non_existing(self, user_mgt_app):

@@ -464,6 +465,7 @@ def generate_email_verification_link(self, email, action_code_settings=None):

Raises:
ValueError: If the provided arguments are invalid
UserNotFoundError: If no user exists by the specified email address.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be EmailNotFoundError?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately, this is the problem. They throw different errors. For password reset, they throw EMAIL_NOT_FOUND. For email verification, they throw USER_NOT_FOUND.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, fair enough 👍

@bojeil-google
Copy link
Contributor Author

One possible typo. Can we also add a test case? Similar to:

def test_get_user_non_existing(self, user_mgt_app):

Done

Copy link
Contributor

@hiranya911 hiranya911 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. LGTM!

@hiranya911 hiranya911 assigned egilmorez and unassigned hiranya911 May 3, 2021
Copy link

@egilmorez egilmorez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LG, one tiny nit.

@@ -444,6 +444,7 @@ def generate_password_reset_link(self, email, action_code_settings=None):

Raises:
ValueError: If the provided arguments are invalid
EmailNotFoundError: If no user exists by the specified email address.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a specific reason to use "by" here?

I'd expect "for" probably, here and below.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for catching. I copied and pasted blindly. It is fixed now here and elsewhere.

@bojeil-google bojeil-google merged commit 527a824 into master May 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants